Skip to content

TST: Refactor slow test #53610

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2023
Merged

TST: Refactor slow test #53610

merged 1 commit into from
Jun 13, 2023

Conversation

mroeschke
Copy link
Member

Went from 2s to 0.05s locally

@mroeschke mroeschke added the Testing pandas testing functions or related to the test suite label Jun 12, 2023
with tm.assert_produces_warning(FutureWarning, match=msg):
for i in range(1000):
len(algos.unique(lst))
lst = np.array(["A", "B", "C", "D", "E"], dtype=object)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would this still catch the original refcount bug?

im guessing we'd get most of the performance improvement by passing check_stacklevel=False to assert_produces_warning

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah looking back it appears this should have still happened if a numpy array is passed, so I think preemptively changing to address the FutureWarning too is OK

@mroeschke mroeschke added this to the 2.1 milestone Jun 12, 2023
@mroeschke
Copy link
Member Author

Going to merge since we have testing of this FutureWarning elsewhere

@mroeschke mroeschke merged commit 7287eaf into pandas-dev:main Jun 13, 2023
@mroeschke mroeschke deleted the tst/slow branch June 13, 2023 17:25
Daquisu pushed a commit to Daquisu/pandas that referenced this pull request Jul 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Testing pandas testing functions or related to the test suite
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants